package lion.test.foo;

import java.lang.annotation.Annotation;

import lion.framework.core.anno.AnnoProcessor;
import lion.framework.core.anno.AnnotationProcessorManager;
import lion.framework.core.anno.IAnnotationProcessor;
import lion.dev.lang.MapJ;

@AnnoProcessor(Foo.class)
public class FooAnnoProcessor implements IAnnotationProcessor {

	@Override
	public void processe(MapJ ctx, Annotation anno) throws Exception {

		Class<?> clazz = ctx.getE(AnnotationProcessorManager.ANNO_CONTEXT_CLASS);
		if (!IFoo.class.isAssignableFrom(clazz)) { return; }

		FooManager.addFoo((IFoo) clazz.newInstance());

	}
}
